package cn.myschool.myschool.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.*;
import java.io.Serializable;

/**
 * @author oldliu
 * @since 1.0
 */
//和表 s_subject对应
@TableName("s_subject")
public class Subject implements Serializable {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long gradeid;
    private String subjectname;
    private int classhour;
    //年级名称
    @TableField(exist = false)
    private String gname;

    //List<ExamResult>  exams= new

    private  List<ExamResult> exams=new ArrayList<>(0);
    public Subject() {
    }

    public Subject(Long id, Long gradeid, String subjectname, int classhour) {
        this.id = id;
        this.gradeid = gradeid;
        this.subjectname = subjectname;
        this.classhour = classhour;
    }

    public List<ExamResult> getExams() {
        return exams;
    }

    public void setExams(List<ExamResult> exams) {
        this.exams = exams;
    }

    public Subject(Long gradeid, String subjectname, int classhour) {
        this.gradeid = gradeid;
        this.subjectname = subjectname;
        this.classhour = classhour;
    }

    public String getGname() {
        return gname;
    }

    public void setGname(String gname) {
        this.gname = gname;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getGradeid() {
        return gradeid;
    }

    public void setGradeid(Long gradeid) {
        this.gradeid = gradeid;
    }

    public String getSubjectname() {
        return subjectname;
    }

    public void setSubjectname(String subjectname) {
        this.subjectname = subjectname;
    }

    public int getClasshour() {
        return classhour;
    }

    public void setClasshour(int classhour) {
        this.classhour = classhour;
    }

    @Override
    public String toString() {
        return "课程{" +
                "id=" + id +
                ", gradeid=" + gradeid +
                ", subjectname='" + subjectname + '\'' +
                ", classhour=" + classhour +
                '}';
    }
}
